﻿<?php
$sql = "SELECT * FROM ".$tb_prefix."user WHERE user_identifier = '".$_SESSION['identifier']."'";
$query = $mysql->query($sql);
if ($mysql->num_rows($query)) {
$row = mysql_fetch_array($query);
$ten = $row['user_fullname'];
$chuky = $row['user_signature'];
$ym = $row['user_ym'];
$sex = $row['user_sex'];
$ava =  $row['user_avatar'];
	if(isset($_POST['submit'])) {
		$name = m_htmlchars(stripslashes(trim(urldecode($_POST['name']))));
		$yahoo = m_htmlchars(stripslashes(trim(urldecode($_POST['ym']))));
		$gioitinh = m_htmlchars(stripslashes(trim(urldecode($_POST['sex']))));
		$signature = m_htmlchars(stripslashes(trim(urldecode($_POST['signature']))));
		$avatar = m_htmlchars(stripslashes(trim(urldecode($_POST['avatar']))));
		$mysql->query("UPDATE ".$tb_prefix."user SET user_fullname = '".$name."', user_avatar = '".$avatar."' ,user_signature = '".$signature."', user_ym = '".$yahoo."', user_sex = '".$gioitinh."' WHERE user_id = '".$_SESSION['user_id']."'");
		echo "<script language='JavaScript'>{ window.parent.location='memcp.php?id=".$_SESSION['identifier']."&act=edit_info' }</script>";

	}
	
?>
<script src="js/check_form.js"></script>
<script src="../js/load.js"></script>
<div id="wait"></div>


		<form name='add' action='memcp.php?id=<?=$_SESSION['identifier'];?>&act=edit_info' method="post" enctype="multipart/form-data" onsubmit="wait()">
			<table width=750px>
						<tr><td class=fr width=100px>- Họ tên </td><td class=fr_2><input type=text name="name" size=50 value="<?=$ten;?>"></td></tr>
                        <tr><td class=fr width=100px>- Avatar </td><td class=fr_2><input type=text name="avatar" size=50 value="<?=$ava;?>"> link avatar cua ban</td></tr>
						<tr><td class=fr width=100px>- Yahoo ! Chat </td><td class=fr_2><input type=text name="ym" size=50 value="<?=$ym;?>"></td></tr>
						<tr><td class=fr width=100px>- Giới tính </td><td class=fr_2><?=acp_user_sex($sex);?></td></tr>
                        

		<tr><td class=fr><span>Chữ ký: </span></td><td class=fr_2>
		

			<textarea cols="60" class="inputbox" class="form" name="signature" id="signature" rows="5"  ><?=$chuky;?></textarea></p>
	</td></tr>
			<tr><td></td><td align=left><input type="submit" name="submit" value="Submit" onclick="return checkform()"><input type="reset" value="Reset"></td></tr>

			</table>
			
		</form>
<? } ?>